package com.foreverwin.jzymes.eap.Listener;

import com.alibaba.fastjson.JSONObject;
import com.foreverwin.jzymes.framework.event.AppEvent;
import com.foreverwin.jzymes.framework.event.AppEventPublisher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

@Component
public class AppEventListener {

    @Autowired
    AppEventPublisher appEventPublisher;

    @JmsListener( destination = "MES_APP_EVENT_INFRA", containerFactory="jmsTopicListenerContainerFactory" )
    public void onMessage( AppEvent<JSONObject> appEvent ){
        appEventPublisher.publishEvent( appEvent );
    }
}
